{% extends "master.html" %}
{% block subtitle %} - 采购管理 - 采购单详情{% endblock %}

{% block extCSS %}
<link href="{{url_for('static', filename='css/colorbox.css')}}" rel="stylesheet" type="text/css" />
{% endblock %}

{% block extJS %}
<script src="{{url_for('static', filename='js/jquery.colorbox-min.js')}}" type="text/javascript"></script>
<script src="{{url_for('static', filename='js/jquery.colorbox-zh-CN.js')}}" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
//<![CDATA[
    $(document).ready(function(){
        $(".colorbox").colorbox();
    });
//]]>
</script>
{% endblock %}


{% block main %}
<div class="container">
    <div class="row">
        <ol class="breadcrumb">
          <li><a href="{{url_for('bpRoot.view')}}">基础信息</a></li>
          <li><a href="{{url_for('bpPrh.view')}}">采购管理</a></li>
          <li class="active">采购单详情</li>
        </ol>
    </div>
    <div class="row">
        <ul class="nav nav-tabs">
          <li class="active"><a href="#">采购单详情</a></li>
          <li><a href="{{url_for('.view',action='viewLog',id=obj.id)}}">日志记录</a></li>
        </ul>
    </div>
    <div class="row">
        <div class="btn-toolbar pull-right">
            {% if obj.editable() %}
                <div class="btn-group"><a class="btn btn-default" href="{{url_for('.view',action='update',id=obj.id)}}">{{BTN_UPDATE}}</a></div>
            {% endif %}
            {% if obj.approvable() %}
                <div class="btn-group"><a class="btn btn-primary" href="{{url_for('.view',action='app',id=obj.id)}}">{{BTN_ACCEPT}}</a></div>
            {% endif %}
            {% if obj.deletable() %}
            <div class="btn-group"><a class="btn btn-danger" href="{{url_for('.view',action='delete',id=obj.id)}}">{{BTN_DELETE}}</a></div>
            {% endif %}
        </div>
    </div>
    <div class="row">
        <fieldset>
            <legend>采购单详情</legend>
            <div class="col-md-4">
                <h4>系统编号</h4><p>{{obj.no}}&nbsp;</p>
                <h4>供应商</h4><p>{{obj.supplier|f}}&nbsp;</p>
                <h4>联系人</h4><p>{{obj.att|f}}&nbsp;</p>
                <h4>联系电话</h4><p>{{obj.tel|f}}&nbsp;</p>
                <h4>联系手机</h4><p>{{obj.mobile|f}}&nbsp;</p>
            </div>
            <div class="col-md-4">      
                <h4>采购日期</h4><p>{{obj.createTime|ft}}&nbsp;</p>
                <h4>经办人</h4><p>{{obj.createBy}}&nbsp;</p>
                <h4>备注</h4><p>{{obj.remark|f}}&nbsp;</p>
            </div>
            <div class="col-md-4">
                <h4>总金额</h4><p>{{obj.realAmount}}&nbsp;</p>
            </div>      
            <div class="col-md-12">
             <h4>附件</h4>
                {{mymacros.render_preview_all_attachment(obj.attachment)}}
            </div>                
            <div class="col-md-12">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <td class="col-md-3">商品编号</td>
                            <td>商品名称</td>
                            <td>商品类型</td>
                            <td class="col-md-2">商品价钱</td>
                            <td class="col-md-2">采购价钱</td>
                            <td class="col-md-1">数量</td>
                            <td class="col-md-2">备注</td>
                        </tr>
                    </thead>
                    <tbody>
                        {% for r in obj.dtls %}
                            <tr>
                                <td>{{mymacros.render_goto_popup_pdt(r.pdt, loop.first)}}</td>
                                <td>{{r.pdtname}}</td>
                                <td>{{r.pdttype|f}}</td>
                                <td>{{r.pdtpPrice|f}}</td>
                                <td>{{r.realPrice|f}}</td>
                                <td>{{r.qty}}</td>
                                <td>{{r.remark|f}}</td>
                            </tr>
                        {% endfor %}
                    </tbody>                
                </table>             
            </div>
       </fieldset>
       {{mymacros.render_system_info(obj)}}
    </div>
</div>    
   
{% endblock %}